/*
 * 版权所有 (c) 2022-2099 TBIT。保留所有权利。
 */

package com.tbit.uqbike.service.business.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tbit.uqbike.object.pojo.RecoveryLog;
import com.tbit.uqbike.service.base.CalibrateService;
import com.tbit.uqbike.service.base.MachineService;
import com.tbit.uqbike.service.business.RecoveryLogService;
import com.tbit.uqbike.service.business.StockMachineService;
import com.tbit.uqbike.service.rpcservice.MachineStatusService;
import com.tbit.uqbike.webmanager.dao.log.RecoveryLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @Author: chen
 * @Description: 车辆回收记录
 * @Date: 创建于 15:23 2023/2/9
 */
@Service
public class RecoveryLogServiceImpl extends ServiceImpl<RecoveryLogMapper, RecoveryLog> implements RecoveryLogService {


    @Autowired
    private MachineService machineService;
    @Autowired
    private MachineStatusService machineStatusService;
    @Autowired
    private StockMachineService stockMachineService;
    @Autowired
    private CalibrateService calibrateService;
    @Resource
    private RecoveryLogMapper recoveryLogMapper;


    @Override
    public RecoveryLog getByAccountId(Integer accountId, Integer machineId, Integer state) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("accountId", accountId);
        queryWrapper.eq("machineId", machineId);
        queryWrapper.eq("state", state);
        RecoveryLog recoveryLog = recoveryLogMapper.selectOne(queryWrapper);
        return recoveryLog;
    }




}
